/**
 * @file categories/dp/probability/roaming/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/3 10:59:43
 **/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
const int N = 500 + 10, M = 300010;
const double eps = 1e-9;
int n, m, tot;
int fr[M], to[M], nxt[M], hd[N], deg[N];
int u[M], v[M];
double a[N][M], g[M], ans;
void insert(int u, int v) {
  fr[++tot] = u, to[tot] = v;
  nxt[tot] = hd[u], hd[u] = tot;
  fr[++tot] = v, to[tot] = u, nxt[tot] = hd[v], hd[v] = tot;
  deg[u]++, deg[v]++;
}
int main() {
  // High rating and good luck!
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> u[i] >> v[i];
    insert(u[i], v[i]);
  }
  n--;
  a[1][n + 1] = -1.0;
  for (int u = 1; u <= n; ++u) {
    a[u][u] = -1;
    for (int i = hd[u]; i; i = nxt[i])
      if (to[i] != n + 1) a[u][to[i]] = 1.0 / deg[to[i]];
  }

  for (int i = 1; i <= n; ++i) {
    int r = i;
    for (int j = i + 1; j <= n; ++j)
      if (abs(a[j][i]) > abs(a[r][i])) swap(r, j);
    if (r != i)
      for (int j = 1; j <= n + 1; ++j) swap(a[i][j], a[r][j]);
    if (abs(a[i][i]) < eps) continue;
    for (int j = n + 1; j >= i; --j)
      for (int k = i + 1; k <= n; ++k) a[k][j] -= a[k][i] / a[i][i] * a[i][j];
  }
  for (int i = n; i; i--) {
    for (int j = i + 1; j <= n; ++j) {
      a[i][n + 1] -= a[j][n + 1] * a[i][j];
    }
    a[i][n + 1] /= a[i][i];
  }

  for (int i = 1; i <= m; ++i) {
    g[i] = a[u[i]][n + 1] / deg[u[i]] + a[v[i]][n + 1] / deg[v[i]];
  }
  sort(g + 1, g + m + 1);
  for (int i = 1; i <= m; ++i) ans += g[i] * (m - i + 1);

  printf("%.3lf\n", ans);

  return 0;
}
